<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/page/common/public.jspf"%>
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta content="max-age=0" http-equiv="Cache-Control" />
<meta content="width=device-width; initial-scale=1.2; minimum-scale=1.0; maximum-scale=2.0" name="viewport" />
<meta content="telephone=no" name="format-detection" />
<meta content="240" name="MobileOptimized" />
<title>绑定银行卡列表</title>
<script type="text/javascript" src="${path }/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="${path }/js/helper.js"></script>
<link href="${skin }/css/public.css" rel="stylesheet" type="text/css" />
<link href="${skin }/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	$(function() {
		$("#bankList>li>span>a").click(function(){
			var bindAccountId = $(this).attr("lang");
			var type = $(this).attr("v");
			if(type == 'bianji')
			{
				location.href=Helper.basePath+"/memberCenter/member_operate/bindAccount/onEdit/"+bindAccountId+".htm";
			}
			else if(type == 'shanchu')
			{
				if(window.confirm("确认删除吗？"))
				{
					new Helper.RemoteTrans({
						url:Helper.basePath+"/memberCenter/member_operate/removeBindAccount/"+bindAccountId+".htm",
						onSuccess:function(data){
							if(data===true)
							{
								Helper.message("网上提现银行账号删除成功！", function(){window.location.reload();});
								 location.replace(location.href);
							}else
							{
								Helper.message("网上提现银行账号删除失败！");
							 	return;
							}
						}
					}).send();
				}
			}
			else if(type == 'youxian')
			{
				//绑定设置优先级事件
				new Helper.RemoteTrans({
					url:Helper.basePath+"/memberCenter/member_operate/setIsPriority/"+bindAccountId+".htm",
					onSuccess:function(data){
						if(data===true)
						{
							Helper.message("恭喜您,优先级设置成功!");
						}else
						{
							Helper.message("设置优先级失败,请刷新重试!");
							return;
						}
					}
				}).send();
			}
		});
	});
</script>
</head>

<body>
	<c:import url="/page/common/head.jsp">
		<c:param name="type">wdcp</c:param>
	</c:import>
	<div class="kj_content">
		<div class="tz_title center s_16">我的银行卡</div>
		<div>
			<c:choose>
    		<c:when test="${fn:length(bindAccouts)==0}">
				<div class="pt_5 pr_10 pl_10 center">
					<span class="s_14 lh_46">暂无绑定银行卡</span>
				</div>
			</c:when>
    		<c:otherwise>
				<div class="pt_5 pr_10 pl_10 pb_5">
					<span class="s_14">已绑定银行卡</span>
				</div>
				<div class="banding s_14">
					<ul id="bankList">
						<c:forEach items="${bindAccouts }" var="bank">
							<li v="农业银行" t="bank">
								<span class="r">
 									<a class="mr_20" href="javascript:void(0)" v="bianji" lang="${bank.id }">编辑</a>
									<a href="javascript:void(0)" v="shanchu" lang="${bank.id}">删除</a>
									<div></div>
									<c:if test="${storeId!='1020'}">
									<a class="mr_20" href="javascript:void(0)" v="youxian" lang="${bank.id }">设置优先级</a>
									</c:if>
								</span>
								<i class="icon_bank">
									<img src="${skin }/images/${bank.bankName}.png" alt="银行">
								</i> 
								${bank.bankName.text }
								<div></div>
								<i>${fn:substring(bank.accountNo,0,4)}**********${fn:substring(bank.accountNo,fn:length(bank.accountNo)-4,fn:length(bank.accountNo))}</i>
							</li>
						</c:forEach>
					</ul>
				</div>
			</c:otherwise>
    	</c:choose>
    	<c:if test="${storeId=='1020' && fn:length(bindAccouts)<1}">
    		<div class="btn_line pt_15 pl_20 pr_20 pb_20">
			<a href="/page/memberinfo/bank/bindbank.jsp"><span class="ui_btn ui_btn_blue" style="display: block;">新增银行卡</span></a>
			</div>
    	</c:if>
		<c:if test="${storeId=='1010'}">
    		<div class="btn_line pt_15 pl_20 pr_20 pb_20">
			<a href="/page/memberinfo/bank/bindbank.jsp"><span class="ui_btn ui_btn_blue" style="display: block;">新增银行卡</span></a>
			</div>
    	</c:if>
		</div>
	</div>
	<c:import url="/page/common/bottom.jsp"></c:import>
</body>
</html>
